<?php
// +-----------------------------------------------
// | Name： 星空框架  用户银行卡绑定规则
// +-----------------------------------------------
// | Version: V5.0
// +-----------------------------------------------
// | Author: xkyinzhe <zhonghuaxinxing@sina.cn>
// +-----------------------------------------------
// | Time: 2021-05-20 16:27
// +-----------------------------------------------
declare(strict_types=1);

namespace app\common\validate;

use think\Validate;

/**
 * @xk 用户银行卡绑定规则
 */
class UserBank extends Validate
{
  protected $rule = [
    'user_bank_id' => 'require|min:1',
    'name' => 'require',
    'bank_num' => 'require|number',
    'bank_num' => 'unique:userBank,user_sn^bank_num^delete_time',
    'bank_name|开户行' => 'require',
  ];
  protected $message = [
    'user_bank_id' => '请选择需要编辑的银行账户',
    'name.require' => '请填写姓名',
    'bank_num.require' => '银行卡号不符合规则',
    'bank_num.unique' => '您已经绑定过该银行账户',
    'bank_name' => '请输入开户行'
  ];
  protected $scene = [
    'create' => ['name','bank_num','bank_name'],
    'edit' => ['user_bank_id','name','bank_num','bank_name']
  ];

}
